<?php
namespace DesignModel\decorator;
/**
 * Created by PhpStorm.
 * User: 554665488
 * Date: 2018-6-20
 * Time: 22:07
 * @description:第二个装饰器
 * @Author: yfl
 * @QQ 554665488
 */

class Decoretor2 implements \DesignModel\decorator\DecoratorApi
{
    protected $params;

    public function __construct($params)
    {
        $this->params = $params;
    }

    public function beforeDraw()
    {
        // TODO: Implement beforeDraw() method.
        echo '改变画图的动作 不需要执行原来功能代码'."<br/>";
        echo "<div style='width: {$this->params['width']}'>";

//       exit();
    }

    public function afterDraw()
    {
        // TODO: Implement afterDraw() method.
        echo "</div>";
        echo '改变画图的动作 需要执行原来功能代码';
    }


}
